package com.wbao.dianniu.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.umeng.analytics.MobclickAgent;
import com.wbao.dianniu.R;

/**
 * 岗位预览
 * 
 * @author yejianjun
 *
 */
public class RecruitPreviewActivity extends BaseActivity {

	private 	TextView tv_post;
	private 	TextView tv_trial ;
	private TextView tv_trial_ruel;
	private 	TextView tv_salary;
	private 	TextView tv_address;
	private 	TextView tv_recruitCount;
	private 	TextView tv_experience;
	private 	TextView tv_education;
	private 	TextView tv_describle;
	
	public static final String BUNDLE_PREVIEW = "recruit_preview_bundle";
	public static final String BUNDLE_POST = "bundle.post";
	public static final String BUNDLE_TRYOUT = "bundle.tryout";
	public static final String BUNDLE_SALARY = "bundle.salary";
	public static final String BUNDLE_ADDRESS = "bundle.address";
	public static final String BUNDLE_RECRUITCOUNT = "bundle.recruitCount";
	public static final String BUNDLE_EXPERIENCE = "bundle.experience";
	public static final String BUNDLE_EDUCATION = "bundle.education";
	public static final String BUNDLE_DESCRIBLE = "bundle.describle";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentLayout(R.layout.recruit_preview);
		setTitleName(getResources().getString(R.string.recruit_preview));
		init();
		Intent intent = getIntent();
		Bundle bundle = intent.getBundleExtra(BUNDLE_PREVIEW);
		tv_post.setText(bundle.getString(BUNDLE_POST) == null ? "" :bundle.getString(BUNDLE_POST) );
		tv_trial.setText(bundle.getString(BUNDLE_TRYOUT) == null ? "" :bundle.getString(BUNDLE_TRYOUT) );
		tv_salary.setText(bundle.getString(BUNDLE_SALARY) == null ? "" : bundle.getString(BUNDLE_SALARY));
		tv_address.setText(bundle.getString(BUNDLE_ADDRESS) == null ? "" : bundle.getString(BUNDLE_ADDRESS));
		tv_recruitCount.setText(bundle.getString(BUNDLE_RECRUITCOUNT) == null ? "" : bundle.getString(BUNDLE_RECRUITCOUNT));
		tv_experience.setText(bundle.getString(BUNDLE_EXPERIENCE) == null ? "" : bundle.getString(BUNDLE_EXPERIENCE));
		tv_education.setText(bundle.getString(BUNDLE_EDUCATION) == null ? "" : bundle.getString(BUNDLE_EDUCATION));
		tv_describle.setText(bundle.getString(BUNDLE_DESCRIBLE) == null ? "" : bundle.getString(BUNDLE_DESCRIBLE)  );
	}
	private void init(){
		tv_post = (TextView) findViewById(R.id.recruit_detail_post);
		tv_trial = (TextView) findViewById(R.id.recruit_detail_trial);
		tv_trial_ruel = (TextView) findViewById(R.id.recruit_detail_trial_ruel);
		tv_salary = (TextView) findViewById(R.id.recruit_detail_salary);
		tv_address = (TextView) findViewById(R.id.recruit_detail_address);
		tv_recruitCount = (TextView) findViewById(R.id.recruit_detail_recruitCount);
		tv_experience = (TextView) findViewById(R.id.recruit_detail_experience);
		tv_education = (TextView) findViewById(R.id.recruit_detail_education);
		tv_describle = (TextView) findViewById(R.id.recruit_detail_describe);
		tv_trial_ruel.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		super.onClick(v);
		switch (v.getId()) {
		case R.id.recruit_detail_trial_ruel:
			Intent intent = new Intent();
			intent.setClass(this, TrialRuelActivity.class);
			startActivity(intent);
			break;
		default:
			break;
		}
	}
	public void onResume() {
		super.onResume();
		MobclickAgent.onResume(this);
		}
		public void onPause() {
		super.onPause();
		MobclickAgent.onPause(this);
		}
}
